<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Unity ML-Agents Toolkit: RayPerceptionOutput.RayOutput Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygenbase.css" rel="stylesheet" type="text/css" />
<link href="unity.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Unity ML-Agents Toolkit
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">RayPerceptionOutput.RayOutput Struct Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Contains the data generated from a single ray of a ray perception sensor.  
 <a href="structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a77b78caff6a91124aebae955da44a047"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput.html#a77b78caff6a91124aebae955da44a047">ToFloatArray</a> (int numDetectableTags, int rayIndex, float[] buffer)</td></tr>
<tr class="memdesc:a77b78caff6a91124aebae955da44a047"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes the ray output information to a subset of the float array.  <a href="structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput.html#a77b78caff6a91124aebae955da44a047">More...</a><br /></td></tr>
<tr class="separator:a77b78caff6a91124aebae955da44a047"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a5306dc49b1541fc5bfaa11a8f0dc604d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput.html#a5306dc49b1541fc5bfaa11a8f0dc604d">HasHit</a></td></tr>
<tr class="memdesc:a5306dc49b1541fc5bfaa11a8f0dc604d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Whether or not the ray hit anything.  <a href="structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput.html#a5306dc49b1541fc5bfaa11a8f0dc604d">More...</a><br /></td></tr>
<tr class="separator:a5306dc49b1541fc5bfaa11a8f0dc604d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a656a77114f8c90b5a076cdabdb345d3b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput.html#a656a77114f8c90b5a076cdabdb345d3b">HitTaggedObject</a></td></tr>
<tr class="memdesc:a656a77114f8c90b5a076cdabdb345d3b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Whether or not the ray hit an object whose tag is in the input's DetectableTags list.  <a href="structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput.html#a656a77114f8c90b5a076cdabdb345d3b">More...</a><br /></td></tr>
<tr class="separator:a656a77114f8c90b5a076cdabdb345d3b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14866b1f612aaf2b501c7ed2fdb22402"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput.html#a14866b1f612aaf2b501c7ed2fdb22402">HitTagIndex</a></td></tr>
<tr class="memdesc:a14866b1f612aaf2b501c7ed2fdb22402"><td class="mdescLeft">&#160;</td><td class="mdescRight">The index of the hit object's tag in the DetectableTags list, or -1 if there was no hit, or the hit object has a different tag.  <a href="structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput.html#a14866b1f612aaf2b501c7ed2fdb22402">More...</a><br /></td></tr>
<tr class="separator:a14866b1f612aaf2b501c7ed2fdb22402"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1156d83708720da9783a481685330e21"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput.html#a1156d83708720da9783a481685330e21">HitFraction</a></td></tr>
<tr class="memdesc:a1156d83708720da9783a481685330e21"><td class="mdescLeft">&#160;</td><td class="mdescRight">Normalized distance to the hit object.  <a href="structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput.html#a1156d83708720da9783a481685330e21">More...</a><br /></td></tr>
<tr class="separator:a1156d83708720da9783a481685330e21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad49554cc82a4a832b5513d196c033dab"><td class="memItemLeft" align="right" valign="top">GameObject&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput.html#ad49554cc82a4a832b5513d196c033dab">HitGameObject</a></td></tr>
<tr class="memdesc:ad49554cc82a4a832b5513d196c033dab"><td class="mdescLeft">&#160;</td><td class="mdescRight">The hit GameObject (or null if there was no hit).  <a href="structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput.html#ad49554cc82a4a832b5513d196c033dab">More...</a><br /></td></tr>
<tr class="separator:ad49554cc82a4a832b5513d196c033dab"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Contains the data generated from a single ray of a ray perception sensor. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a77b78caff6a91124aebae955da44a047"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a77b78caff6a91124aebae955da44a047">&#9670;&nbsp;</a></span>ToFloatArray()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ToFloatArray </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>numDetectableTags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>rayIndex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float[]&#160;</td>
          <td class="paramname"><em>buffer</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Writes the ray output information to a subset of the float array. </p>
<p>Each element in the rayAngles array determines a sublist of data to the observation. The sublist contains the observation data for a single cast. The list is composed of the following:</p><ol type="1">
<li>A one-hot encoding for detectable tags. For example, if DetectableTags.Length = n, the first n elements of the sublist will be a one-hot encoding of the detectableTag that was hit, or all zeroes otherwise.</li>
<li>The 'numDetectableTags' element of the sublist will be 1 if the ray missed everything, or 0 if it hit something (detectable or not).</li>
<li>The 'numDetectableTags+1' element of the sublist will contain the normalized distance to the object hit, or 1.0 if nothing was hit.</li>
</ol>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">numDetectableTags</td><td></td></tr>
    <tr><td class="paramname">rayIndex</td><td></td></tr>
    <tr><td class="paramname">buffer</td><td>Output buffer. The size must be equal to (numDetectableTags+2) * RayOutputs.Length</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a5306dc49b1541fc5bfaa11a8f0dc604d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5306dc49b1541fc5bfaa11a8f0dc604d">&#9670;&nbsp;</a></span>HasHit</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool HasHit</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Whether or not the ray hit anything. </p>

</div>
</div>
<a id="a1156d83708720da9783a481685330e21"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1156d83708720da9783a481685330e21">&#9670;&nbsp;</a></span>HitFraction</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float HitFraction</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Normalized distance to the hit object. </p>

</div>
</div>
<a id="ad49554cc82a4a832b5513d196c033dab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad49554cc82a4a832b5513d196c033dab">&#9670;&nbsp;</a></span>HitGameObject</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">GameObject HitGameObject</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The hit GameObject (or null if there was no hit). </p>

</div>
</div>
<a id="a656a77114f8c90b5a076cdabdb345d3b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a656a77114f8c90b5a076cdabdb345d3b">&#9670;&nbsp;</a></span>HitTaggedObject</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool HitTaggedObject</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Whether or not the ray hit an object whose tag is in the input's DetectableTags list. </p>

</div>
</div>
<a id="a14866b1f612aaf2b501c7ed2fdb22402"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14866b1f612aaf2b501c7ed2fdb22402">&#9670;&nbsp;</a></span>HitTagIndex</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HitTagIndex</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The index of the hit object's tag in the DetectableTags list, or -1 if there was no hit, or the hit object has a different tag. </p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="RayPerceptionSensor_8cs.html">RayPerceptionSensor.cs</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespaceUnity.html">Unity</a></li><li class="navelem"><a class="el" href="namespaceUnity_1_1MLAgents.html">MLAgents</a></li><li class="navelem"><a class="el" href="namespaceUnity_1_1MLAgents_1_1Sensors.html">Sensors</a></li><li class="navelem"><a class="el" href="namespaceUnity_1_1MLAgents_1_1Sensors.html#classUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput">RayPerceptionOutput</a></li><li class="navelem"><a class="el" href="structUnity_1_1MLAgents_1_1Sensors_1_1RayPerceptionOutput_1_1RayOutput.html">RayOutput</a></li>
  </ul>
</div>
</body>
</html>
